package com.tdd;

import static org.junit.Assert.assertEquals;

import java.math.BigDecimal;

import org.junit.Before;
import org.junit.Test;

public class HpStackTest {
	private HpStack stack;

	@Before
	public void init() {
		stack = new HpStack();
	}
	
	@Test
	public void newStackAlwaysHasAValue() {
		assertEquals(0, stack.peek());
	}
	
	@Test
	public void numbersEnteredAreReturnedLifo() {
		stack.push(new BigDecimal(3));
		stack.push(new BigDecimal(2));
		stack.push(new BigDecimal(1));

		assertEquals(BigDecimal.ONE, stack.pop());
		assertEquals(2, stack.pop());
		assertEquals(3, stack.pop());
	}
}
